Add Temporal Nexus Operation Handler#2842
Open
Quinn-With-Two-Ns wants to merge 8 commits intotemporalio:masterfrom
Open
Add Temporal Nexus Operation Handler#2842Quinn-With-Two-Ns wants to merge 8 commits intotemporalio:masterfrom
Quinn-With-Two-Ns wants to merge 8 commits intotemporalio:masterfrom
Conversation
a33ff01 to
7e61dab
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 7e61dab. Configure here.
| throw new HandlerException( | ||
| HandlerException.ErrorType.INTERNAL, | ||
| new IllegalStateException("TemporalOperationResult must be either sync or async")); | ||
| } |
There was a problem hiding this comment.
Unreachable else branch is dead code
Low Severity
The else branch in TemporalOperationHandler.start() is unreachable dead code. TemporalOperationResult.isSync() returns the isSync field, and isAsync() returns !isSync — they are always complementary. No instance of TemporalOperationResult can ever be neither sync nor async, so the HandlerException at the bottom can never be thrown.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 7e61dab. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Add TemporalOperationHandler for generic Nexus operations
Summary
Test plan
Note
Medium Risk
Introduces new (experimental) Nexus handler/client surface area and changes operation-token parsing/validation, which could affect async operation start/cancel behavior and cross-SDK token compatibility.
Overview
Adds an experimental generic
TemporalOperationHandlerfor Nexus that lets handlers return either a synchronous value or an async operation token viaTemporalOperationResult, with default cancel behavior that dispatches based on parsed operation-token type.Introduces
TemporalNexusClient(+TemporalNexusClientImpl) to start typed/untyped workflows from Nexus handlers, including a guard that only allows one async workflow start per handler invocation, and factors shared start+link-attachment logic intoNexusStartWorkflowHelper(also used byWorkflowRunOperationImpl).Renames/expands operation-token handling by replacing
WorkflowRunOperationTokenwith a generalOperationTokenand addingOperationTokenUtil.loadOperationToken(type-agnostic) while keepingloadWorkflowRunOperationTokenfor type assertions; updates/extends tests to cover new generic handler paths and token validation edge cases.Reviewed by Cursor Bugbot for commit 7e61dab. Bugbot is set up for automated code reviews on this repo. Configure here.